package com.t4;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xuyiwei on 2018/7/14.
 */
public class T4_8_9 {
    static List<Integer> list = new ArrayList<>();

    static void printCanshu(int i ){
        int result = 0;
        int one = 1;
        int two = 1;
        while (result!=i){
            if(two==1){
                list.add(one);
                list.add(two);
            }else{
                list.add(two);
            }
            result = one + two;
            one = two;
            two = result;
            System.out.println(result);
        }
    }

    public static void main(String[] args) {
        printCanshu(34);

        System.out.println("=================================");
        for(int i =0;i<list.size();i++){
            System.out.println(list.get(i));
        }
    }
}
